//最小乘车费用 完全背包
#include <iostream>
using namespace std;
const int MAXN=100;
int n;
int c[11];
int minc[MAXN+1];
int main(){
    for(int i=1;i<=10;i++) cin>>c[i];
    cin>>n;
    for(int i=0;i<=n;i++) minc[i]=10*100;
    minc[0]=0;

    for(int i=1;i<=10;i++)
        for(int v=i;v<=n;v++)
            if (minc[v]>minc[v-i]+c[i]) minc[v]=minc[v-i]+c[i];
    
    cout<<minc[n];

}